package com.mmall.controller;

import com.mmall.service.IOrderService;
import entity.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private IOrderService iOrderService;

    @GetMapping("/create/{shippingid}")
    public ServerResponse create(HttpSession session,@PathVariable("shippingid") Integer shippingId) {
        //测试暂时用管理员的userID:1
        return iOrderService.createOrder(1, shippingId);
    }

}
